package io.renren.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.util.StrUtil;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.sys.dao.SysTenantDao;
import io.renren.modules.sys.dto.SysRoleDTO;
import io.renren.modules.sys.dto.SysTenantDTO;
import io.renren.modules.sys.entity.SysTenantEntity;
import io.renren.modules.sys.service.SysTenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/**
 * 商家入驻管理
 *
 * @author mimao funfind@yeah.net
 * @since 1.0.0 2024-01-13
 */
@Service
public class SysTenantServiceImpl extends CrudServiceImpl<SysTenantDao, SysTenantEntity, SysTenantDTO> implements SysTenantService {

    @Autowired
    SysTenantDao sysTenantDao;

    @Override
    public QueryWrapper<SysTenantEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<SysTenantEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }

    @Override
    public void saveInfo(SysTenantEntity param) {
        sysTenantDao.insertSimple(param);
    }
}